package com._23DesignPattern._structure._proxy.StaticProxy;

/**
 * @Author: huangya
 * @Date: 2019/3/9
 * @Description:
 */
public class LogProxy implements IPurchase {

    IPurchase purchase;

    public LogProxy(IPurchase purchase) {
        this.purchase = purchase;
    }

    private void before(){
        System.out.println("before..");
    }

    public void buy() {
        this.before();
        purchase.buy();
        this.after();
    }

    private void after(){
        System.out.println("after..");
    }
}
